using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FrameWork;


public class PlayerUseItem : MonoBehaviour
{
    private void Update()
    {
        if (PlayerInput.Instance.GetIsUseTool)
        {
            // 当前鼠标状态为 使用工具或者物品
            if(PlayerInput.Instance.MouseState != MouseState.UseToolOrItem)
                return;

            if (Player.Instance.GetCurrentInventoryItemName() != null)
            {
                EventSystem.Instance.EventTrigger(EventName.EVENT_TILEMAP_PLANTCROP, PlayerInput.Instance.MouseWorldPosition, Player.Instance.GetCurrentInventoryItemName());
                EventSystem.Instance.EventTrigger(EventName.EVENT_INVENTORY_MODEL_REMOVEITEM, PlayerManager.Instance.Inventory.GetItem(Player.Instance.GetCurrentInventoryItemName()).item, 1);
            }
        }
    }
}
